package com.merelyb.data.service.service.mybatis.dao.affpay;

import com.merelyb.data.service.common.MultiDataSourceContextHolder;
import com.merelyb.data.service.service.mybatis.bean.affpay.AffpayInfo;
import com.merelyb.data.service.service.mybatis.dao.base.BaseDao;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by LiM on 2017/12/15.
 */
@Service
public class AffpayInfoDao extends BaseDao {

    /**
     * 获取所有最小支付类型
     * @param affpayInfo
     * @param sDataBase
     * @return
     * @throws Exception
     */
    public List<String> getAllPayMinType(AffpayInfo affpayInfo, String sDataBase) throws Exception{
        MultiDataSourceContextHolder.setDataSourceType(sDataBase);
        return this.sqlSession.selectList(AffpayInfo.class.getName() + ".getMinType", affpayInfo);
    }

    /**
     * 根据编号查询数据
     * @param IdsList
     * @param sDataBase
     * @return
     */
    public List<AffpayInfo> getAffpayInfoByIds(List<Long> IdsList, String sDataBase) throws Exception{
        MultiDataSourceContextHolder.setDataSourceType(sDataBase);
        return this.sqlSession.selectList(AffpayInfo.class.getName() + ".selectByIds", IdsList);
    }
}
